$(function() {
    getAddress()



    $('.buttom').on('tap', 'li .delete', function() {
        var id = $(this).parents('li').attr('num')
        $.ajax({
            url: '/address/deleteAddress',
            type: 'post',
            data: {
                id: id
            },
            success: function(res) {
                getAddress()
            }
        })
        return false
    })

    function getAddress() {
        $.ajax({
            url: '/address/queryAddress',
            success: function(res) {
                var html = template('tmp', res)
                $('.buttom').html(html)
            }
        })
    }
})